package com.ruoyi.system.service;

public class RedisKeyUtil {
    private static final String SPLIT = ":";
    private static final String PREFIX_ENTITY_LIKE = "like:entity";

    // 某个实体的赞
    // like:entity:entityType:entityId -> set(userId)
    public static String getEntityLikeKey(String entityType, String entityId) {
        return PREFIX_ENTITY_LIKE + SPLIT + entityType + SPLIT + entityId;
    }
    private static final String PREFIX_ENTITY_READ = "read:entity";

    // 某个实体的赞
    // like:entity:entityType:entityId -> set(userId)
    public static String getEntityREADKey(String entityType, String entityId) {
        return PREFIX_ENTITY_READ + SPLIT + entityType + SPLIT + entityId;
    }
    private static final String PREFIX_ENTITY_SHARE = "share:entity";

    // 某个实体的赞
    // like:entity:entityType:entityId -> set(userId)
    public static String getEntitySHAREKey(String entityType, String entityId) {
        return PREFIX_ENTITY_SHARE + SPLIT + entityType + SPLIT + entityId;
    }
}